import * as mine from "../../api/mine";

Page({
    data: {
        userName:""
    },
    onLoad(options){
        this.setData({
            userName:options.name
        })
    },
    getValue(e){
        this.setData({
            userName:e.detail.value
        })
    },
    submit(){
        if(!this.data.userName){
            wx.showToast({
                title: '请输入姓名',
                icon: 'none'
            });
            return;
        }
        mine.modifyUsrName({
            userName:this.data.userName
        })
            .then(()=>{
                wx.navigateBack({
                    delta: 1
                });
            })
    }
})
